Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / core / repository / src / commonMain / kotlin / org / meshtastic / core / repository / LockdownPassphraseStore.kt

Displaying Raw • Download

core/repository/src/commonMain/kotlin/org/meshtastic/core/repository/LockdownPassphraseStore.kt bf929c20f274232e0eb8ddc19b2dc82403e99e5b (bf929c20) Text, 2.16 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.repository

T8b949e/**
* Stored passphrase entry with associated TTL parameters.
*
* @param maxSessionSeconds Per-boot uptime cap, in seconds. 0 = unlimited. Non-zero is firmware-side enforcement: the
* device revokes auth and reboots after this many seconds of uptime even if the boot-count TTL is still valid.
*/
Tff7b72data Tff7b72class T56d364StoredPassphraseTb4b4b4(Tff7b72val Te6edf3passphraseTb4b4b4: Tffa657StringTb4b4b4, Tff7b72val Te6edf3bootsTb4b4b4: Tffa657IntTb4b4b4, Tff7b72val Te6edf3hoursTb4b4b4: Tffa657IntTb4b4b4, Tff7b72val Te6edf3maxSessionSecondsTb4b4b4: Tffa657Int Tff7b72= T79c0ff0Tb4b4b4) Tb4b4b4{
Tff7b72init Tb4b4b4{
Te6edf3requireTb4b4b4(Te6edf3passphraseTb4b4b4.Te6edf3isNotEmptyTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{ Ta5d6ff"Ta5d6ffpassphrase must not be emptyTa5d6ff" Tb4b4b4}
Tb4b4b4}
Tb4b4b4}

T8b949e/**
* Encrypted per-device storage for lockdown passphrases.
*
* Platform implementations should use secure storage (e.g., EncryptedSharedPreferences on Android, Keychain on iOS).
* Passphrase access is NOT gated behind biometric authentication so that auto-unlock can run in the background without
* user interaction.
*/
Tff7b72interface T56d364LockdownPassphraseStore Tb4b4b4{
T8b949e/** Retrieves the stored passphrase for the given device address, or null if not stored. */
Tff7b72fun Td2a8ffgetPassphraseTb4b4b4(Te6edf3deviceAddressTb4b4b4: Tffa657StringTb4b4b4)Tb4b4b4: Te6edf3StoredPassphrase?

T8b949e/** Saves the passphrase and TTL parameters for the given device address. */
Tff7b72fun Td2a8ffsavePassphraseTb4b4b4(Te6edf3deviceAddressTb4b4b4: Tffa657StringTb4b4b4, Te6edf3passphraseTb4b4b4: Tffa657StringTb4b4b4, Te6edf3bootsTb4b4b4: Tffa657IntTb4b4b4, Te6edf3hoursTb4b4b4: Tffa657IntTb4b4b4, Te6edf3maxSessionSecondsTb4b4b4: Tffa657Int Tff7b72= T79c0ff0Tb4b4b4)

T8b949e/** Clears the stored passphrase for the given device address. */
Tff7b72fun Td2a8ffclearPassphraseTb4b4b4(Te6edf3deviceAddressTb4b4b4: Tffa657StringTb4b4b4)

Tff7b72companion Tff7b72object Tb4b4b4{
Tff7b72const Tff7b72val Te6edf3DEFAULT_BOOTS Tff7b72= T79c0ff5T79c0ff0
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.06s